Take care of the case where most_recent_event is nil.

Akinori MUSHA 10 anni fa
parent
commit
23de8735e2
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      app/models/agents/twitter_publish_agent.rb

+ 1 - 1
app/models/agents/twitter_publish_agent.rb

@@ -25,7 +25,7 @@ module Agents
25 25
     end
26 26
 
27 27
     def working?
28
-      event_created_within?(options['expected_update_period_in_days']) && most_recent_event.payload['success'] == true && !recent_error_logs?
28
+      event_created_within?(options['expected_update_period_in_days']) && most_recent_event && most_recent_event.payload['success'] == true && !recent_error_logs?
29 29
     end
30 30
 
31 31
     def default_options